package cn.lanjh.system.feign.factory;

import cn.lanjh.system.feign.RemoteSysConfigService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class RemoteSysConfigFallbackFactory implements FallbackFactory<RemoteSysConfigService>
{
    @Override
    public RemoteSysConfigService create(Throwable throwable)
    {
        log.error(throwable.getMessage());
        return new RemoteSysConfigService()
        {

            @Override
            public String selectConfigByKey(String configKey) {
                return null;
            }
        };
    }
}
